#pragma once

// Forward reference
class WpdObjectProperties;

class SensorBase
{
public:
	SensorBase(WpdObjectProperties* pWpdObjectProperties);
	virtual ~SensorBase(void);

	// abstract method
	virtual VOID AddPropertyKeys(
		IPortableDeviceKeyCollection* pKeys) = 0;
	
	// abstract method
	virtual VOID AddDataFieldKeys(
		IPortableDeviceKeyCollection* pKeys) = 0;

	HRESULT GetPropertyValues(
		IPortableDeviceKeyCollection*  pKeys,
		IPortableDeviceValues*         pValues);

	HRESULT GetDataValues(
		IPortableDeviceKeyCollection*  pKeys,
		IPortableDeviceValues*         pValues);

	HRESULT UpdateSensorReading(
		LONGLONG llSensorReading);

protected:
	GUID					m_gdSensorUniqueId;
	GUID					m_gdSensorCategory;
	GUID					m_gdSensorType;
	LPCWSTR					m_strSensorId;
	LPCWSTR					m_strSensorName;

	WpdObjectProperties*	m_pWpdObjectProperties;
	LONGLONG				m_llSensorReading;
	FILETIME				m_ftLastUpdateTime;

	HRESULT UpdateTimeStamp();

	virtual HRESULT OnGetPropertyValues(PROPERTYKEY &Key, IPortableDeviceValues *pValues);
	virtual HRESULT OnGetDataValues(PROPERTYKEY &Key, IPortableDeviceValues *pValues);
	virtual HRESULT OnUpdateSensorReading();
};
